package com.suke.czx.modules.income.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.suke.czx.common.validate.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 应用模块名称: 收支
 * 代码描述: 收支实体
 * copyright: AUZARI ALL RIGHTS RESERVED
 * company: AUZARI
 *
 * @author: 颜米晨
 * @date: 2021/09/09 10:10:22
 */
@Data
@ApiModel(value = "收支管理")
@EqualsAndHashCode(callSuper = true)
public class Income extends Model<Income> {

    @ApiModelProperty(value = "收支id")
    @TableId(value = "income_id", type = IdType.AUTO)
    @NotNull(groups = {IncomeUpdateGroup.class}, message = "收支编码不能为空")
    public Long incomeId;

    @ApiModelProperty(value = "甲方经办人")
//    @NotBlank(groups = {IncomeSaveGroup.class, IncomeUpdateGroup.class}, message = "甲方经办人不能为空")
    public String otherHandler;

    @ApiModelProperty(value = "经办人")
//    @NotBlank(groups = {IncomeSaveGroup.class, IncomeUpdateGroup.class}, message = "经办人不能为空")
    public String ownerHandler;

    @ApiModelProperty(value = "所属阶段预付款（预付款，尾款，质保金，第二笔，第三笔，第四笔，第五笔）")
    @NotBlank(groups = {IncomeSaveGroup.class, IncomeUpdateGroup.class}, message = "所属阶段预付款不能为空")
    public String payMoment;

    @ApiModelProperty(value = "付款条件")
    public String payCondition;

    @ApiModelProperty(value = "付款比例")
    public String payRatio;

    @ApiModelProperty(value = "金额")
    @NotNull(groups = {IncomeSaveGroup.class, IncomeUpdateGroup.class}, message = "金额不能为空")
    public BigDecimal amount;

    @ApiModelProperty(value = "合同id")
    @NotNull(groups = {IncomeSaveGroup.class, IncomeUpdateGroup.class}, message = "合同编码不能为空")
    public Long contractId;

    @TableField(exist = false)
    @ApiModelProperty(value = "合同名称")
    public String contractName;

    @TableField(exist = false)
    @ApiModelProperty(value = "合同类型")
    public Integer contractType;

    @TableField(exist = false)
    @ApiModelProperty(value = "合同类型名称")
    public String contractTypeName;

    @ApiModelProperty(value = "开户行")
    public String bankName;

    @ApiModelProperty(value = "开户名")
    public String bankAccountName;

    @ApiModelProperty(value = "银行账号")
    public String bankAccount;

    @ApiModelProperty(value = "计划收支id")
    public Long parentId;

    @ApiModelProperty(value = "附件")
    public String fileIds;

    @ApiModelProperty(value = "备注")
    public String note;

    @ApiModelProperty(value = "删除标记  0：删除   1：正常")
    public Integer del;

    @ApiModelProperty(value = "创建者id")
    public Long creator;

    @ApiModelProperty(value = "创建时间")
    public Date createTime;

    @ApiModelProperty(value = "更新者id")
    public Long updater;

    @ApiModelProperty(value = "更新时间")
    public Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "实际收支数据集")
    public List<Income> children;

}
